//字符串
function fn(arr:string):string{
    let arr1=arr.split('')
    arr1=arr1.reverse()
    arr=arr1.join('')
   return arr
}
console.log(fn('abc'));

//转驼峰
function fn2(arr:string):string{
    let arr1=arr.split('-')
    let newarr=arr1[0]
   for (let i = 0; i < arr1.length; i++) {
       newarr+=arr1[i][0].toUpperCase()+arr1[i].slice(1)
   }
     return newarr
   }
   console.log(fn2('hello-world-jiang-guo-qing'));

   
//找最长
function fn1(arr:Array<string>):string{
 arr.sort((a,b)=>b.length-a.length)
 arr.splice(1)
 let data:string=arr.toString()
 return data
}
console.log(fn1(['aa','aaaaaaa','a']));

